fix(explore): expired form data for SQL Lab queries #21430
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
#19981 added the ability for Explore to fallback to default Explore form state (based on chart id or datasource id) had cached form data expires. But this feature is not working for Explore from SQL Lab---because of inconsistent URL parameter names. The
/explore
API expectsdataset_id=xxx
, but SQL Lab page addeddatasource_id=xxx
.This PR fixes this issue and added some backward compatibility so that both
datasource_id
anddataset_id
works.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
When visiting Explore from SQL Lab, You will get
missing_datasource
if your explore form data has expired.After
Explore should load as long as a valid
dataset_id
is providedTESTING INSTRUCTIONS
form_data_key
to an invalid string to simulate expired form data key. For example: http://localhost:9000/explore/?form_data_key=invalid&datasource_id=45&datasource_type=queryADDITIONAL INFORMATION